# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-piplapis-python
_pkgname=piplapis-python
pkgname=('python2-piplapis-python' 'python-piplapis-python')
pkgver=5.3.1
pkgrel=2
pkgdesc='Client library for use with the Pipl search API.'
arch=('any')
url='https://pypi.org/project/piplapis-python/#files'
license=('Apache')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('f2c9a6322b9953af2db3fe9adad2c2e5e917f93f0576f3b57394d50533c24751e9df4df7cd84d3198d85bf5b53f2343907ea4937ff46f9bf921cba190c786dcc')

prepare() {
  cp -a "piplapis-python-$pkgver" "piplapis-python2-$pkgver"
}

build() {
  cd "piplapis-python2-$pkgver"

  python2 setup.py build

  cd "$srcdir/piplapis-python-$pkgver"

  python setup.py build
}

package_python2-piplapis-python() {
  depends=('python2-six' 'python2-pytz')

  cd "piplapis-python2-$pkgver"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-piplapis-python() {
  depends=('python-six' 'python-pytz')

  cd "piplapis-python-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

